<?php
/**
 * IMMOPHP
 * @author Drouche Romain
 * @contact contact@immophp.fr
 * @website www.immophp.fr
 * */
require 'kernel/common.php';

if(!$Session->check_admin())
     redirect('index.php');

require_once IMMOPHP_ROOT_PATH . 'kernel/class/MenuNav.class.php';
require_once IMMOPHP_ADMIN_ROOT_PATH . 'kernel/MenuNavManager.class.php';

$MenuNavManager = new MenuNavManager($paramClass);

if(isset($_GET['move_up'])) $MenuNavManager->setUp( retrieve('GET', 'id'), retrieve('GET', 'position') );
if(isset($_GET['move_down'])) $MenuNavManager->setDown( retrieve('GET', 'id'), retrieve('GET', 'position') );
if(isset($_POST['add_link'])) $MenuNavManager->setAdd();
if(isset($_GET['delete'])) $MenuNavManager->setDelete();

$MenuNav = new MenuNav($paramClass);

$smarty->assign('lignes', $MenuNav->getAll(true) ); // Recuperation des lignes et affichage
$smarty->assign('lang', $lang);
$smarty->assign('token', $Session->_session['token']);
$smarty->assign('new_ordre', $MenuNav->ordreMax + 1);

$smarty->display('menu.tpl');

require_once 'footer.php'
?>
